<template>
  <div class="liuxuetoutiao">
    <div class="liuxuetoutiao_img">
      <img src="/img/lx_index_22.jpg" />
    </div>
    <div class="liuxuetoutiao_title">
      <div class="liuxuetoutiao_title_1s" ref="liuxuetoutiao_title_1s">
        <div class="liuxuetoutiao_title_1" v-for="it in 3" :key="it">
          <h4>无需考成绩留学</h4>
          <p >
              事实上，很多国家的本科留学是无需高考成绩的，只需要参加国内重点大学的国际课程，满足留学条件后，即可由重点大学推荐到国际高校留学，这无疑对提早准备留学学生
            <span>
              <a
                href="https://p.qiao.baidu.com/cps/chat?siteId=17865090&userId=39789408&siteToken=1592882751da134d1450a7e08b16ffcb"
                style="color: #900"
                >查看详情></a
              >
            </span>
          </p>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { onMounted, getCurrentInstance, ref } from "vue";
onMounted((v) => {
  const { refs } = getCurrentInstance();
  const { liuxuetoutiao_title_1s } = refs;
  let index_ = liuxuetoutiao_title_1s.children.length - 1;
  let index = 0;
  let timer = null;
  if (index_) {
    const Fun = function () {
      clearInterval(timer);
      timer = setInterval(function () {
        if (index >= index_) {
          index = 0;
          liuxuetoutiao_title_1s.className = "liuxuetoutiao_title_1s";
          liuxuetoutiao_title_1s.style.transform = "translateY(0px)";
        }
		index += 1;
        liuxuetoutiao_title_1s.style.transform =
          "translateY(" +
          -index * liuxuetoutiao_title_1s.children[0].offsetHeight +
          "px)";
        liuxuetoutiao_title_1s.className =
          "liuxuetoutiao_title_1s liuxuetoutiao_title_1s_";
      }, 2000);
    };
    Fun();
  }
});
</script>

<style scoped>
.liuxuetoutiao {
  width: 100%;
  height: 8rem;
  background-color: #fff;
  box-shadow: 0 0 0.4rem #ccc;
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.liuxuetoutiao_img {
  width: 4rem;
  height: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.liuxuetoutiao_img img {
  width: 2.5rem;
  height: 6rem;
}
.liuxuetoutiao_title {
  width: 10rem;
  height: 6rem;
  margin-top: 1rem;
  overflow: hidden;
  /* background: pink; */
}
.liuxuetoutiao_title_1 {
  width: 100%;
  height: auto;
}
.liuxuetoutiao_title_1 > h4 {
  width: 100%;
  font-size: 0.6rem;
  color: #666;
  line-height: 1.5rem;
  margin-bottom: 0.4rem;
}
.liuxuetoutiao_title_1 > p {
  width: 100%;
  font-size: 0.5rem;
  padding-right: 0.4rem;
  box-sizing: border-box;
}
.liuxuetoutiao_title_1s {
  width: 100%;
  height: auto;
  /* background: orange; */
}
.liuxuetoutiao_title_1s_ {
  transition-duration: 500ms;
  transition-timing-function: ease-in-out;
}
</style>